/*
 * Thread.h
 *
 *  Created on: 22/05/2014
 *      Author: Vitor
 */

#ifndef THREAD_H_
#define THREAD_H_

#include <functional>
#include "SDL2/SDL_thread.h"

class Thread {
private:
	std::function<void()> function;
	SDL_Thread* thread;
	bool started;

	static int start_sdl_thread(void* function);
public:
	Thread(const std::function<void()>& f);

	void start();
	void join();

};

#endif /* THREAD_H_ */
